package idiet.view;

import idiet.Activator;
import idiet.bean.CustomerNurse;
import idiet.bean.CustomerNurseMeal;
import idiet.bean.CustomerNurseMealRecipe;
import idiet.bean.CustomerPal;
import idiet.bean.FoodMaterial;
import idiet.bean.MealFamily;
import idiet.bean.MealTaste;
import idiet.bean.NurseTarget;
import idiet.bean.Unit;
import idiet.service.CustomerNurseMealRecipeService;
import idiet.service.CustomerNurseMealService;
import idiet.service.CustomerNurseService;

import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DateTime;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;

import swing2swt.layout.BorderLayout;

public class ViewPartCustomerNurseMenuView extends ViewPart {
	private Text textCustomerName;
	private Table tableCustomerNurse;
	private Table tableNurseMeal;
	private Table tableNurseMealRecipe;
	private TableViewer tableViewerCustomerNurse;
	private TableViewer tableViewerCustomerNurseMeal;
	private TableViewer tableViewerCustomerNurseMealRecipe;
	private DateTime dateTimeStart;
	private DateTime dateTimeEnd;
	private List<CustomerNurse> customerNurses=new ArrayList<CustomerNurse>();
	private List<CustomerNurseMeal> customerNurseMeals=new ArrayList<CustomerNurseMeal>();
	private List<CustomerNurseMealRecipe> customerNurseMealRecipe=new ArrayList<CustomerNurseMealRecipe>();
	private CustomerNurseService customerNurseService=Activator.getApplicationContext().getBean(CustomerNurseService.class);
	private CustomerNurseMealService customerNurseMealService=Activator.getApplicationContext().getBean(CustomerNurseMealService.class);
	private CustomerNurseMealRecipeService customerNurseMealRecipeService=Activator.getApplicationContext().getBean(CustomerNurseMealRecipeService.class);
	public ViewPartCustomerNurseMenuView() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void createPartControl(Composite parent) {
		parent.setLayout(new GridLayout(2, false));
		
		Composite composite = new Composite(parent, SWT.NONE);
		composite.setLayout(new GridLayout(1, false));
		GridData gd_composite = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
		gd_composite.widthHint = 317;
		composite.setLayoutData(gd_composite);
		
		Composite composite_2 = new Composite(composite, SWT.NONE);
		composite_2.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, true, false, 1, 1));
		composite_2.setLayout(new GridLayout(5, false));
		
		Label lblNewLabel_1 = new Label(composite_2, SWT.NONE);
		lblNewLabel_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		lblNewLabel_1.setText("Date");
		
		dateTimeStart = new DateTime(composite_2, SWT.BORDER);
		
		Label label = new Label(composite_2, SWT.NONE);
		label.setText("-");
		
		dateTimeEnd = new DateTime(composite_2, SWT.BORDER);
		new Label(composite_2, SWT.NONE);
		
		Label lblNewLabel = new Label(composite_2, SWT.NONE);
		lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		lblNewLabel.setText("Customer's Name");
		
		textCustomerName = new Text(composite_2, SWT.BORDER);
		textCustomerName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
		
		Button btnQuery = new Button(composite_2, SWT.NONE);
		GridData gd_btnQuery = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_btnQuery.widthHint = 70;
		btnQuery.setLayoutData(gd_btnQuery);
		btnQuery.setText("Query");
		btnQuery.addSelectionListener(new SelectionAdapter(){

			@Override
			public void widgetSelected(SelectionEvent e) {
				// TODO Auto-generated method stub
				SimpleDateFormat format=new SimpleDateFormat("M/d/yyyy");
				//customer.setForeStartDate(format.parse(StringUtils.substringBetween(dateTimeStart.toString(), "{", "}")));
				if(textCustomerName.getText().trim().equals("")){
					
					if(dateTimeStart.toString().equals(dateTimeEnd.toString())){
						customerNurses=customerNurseService.getCustomerNurses();
					}else{
						try {
							customerNurses=customerNurseService.getCustomerNurses(new Timestamp(format.parse(StringUtils.substringBetween(dateTimeStart.toString(), "{", "}")).getTime()), new Timestamp(format.parse(StringUtils.substringBetween(dateTimeEnd.toString(), "{", "}")).getTime()));
						} catch (ParseException e1) {
							// TODO Auto-generated catch block
							e1.printStackTrace();
						}
					}
				}else{
					if(dateTimeStart.toString().equals(dateTimeEnd.toString())){
						customerNurses=customerNurseService.getCustomerNurses(textCustomerName.getText());
					}else{
						try {
							customerNurses=customerNurseService.getCustomerNurses(textCustomerName.getText(), new Timestamp(format.parse(StringUtils.substringBetween(dateTimeStart.toString(), "{", "}")).getTime()), new Timestamp(format.parse(StringUtils.substringBetween(dateTimeEnd.toString(), "{", "}")).getTime()));
						} catch (ParseException e1) {
							// TODO Auto-generated catch block
							e1.printStackTrace();
						}
					}
				}
				tableViewerCustomerNurse.setInput(customerNurses);
			}
		});
		
		Composite composite_3 = new Composite(composite, SWT.NONE);
		composite_3.setLayout(new BorderLayout(0, 0));
		composite_3.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		
		tableViewerCustomerNurse = new TableViewer(composite_3, SWT.BORDER | SWT.FULL_SELECTION);
		tableCustomerNurse = tableViewerCustomerNurse.getTable();
		tableCustomerNurse.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				StructuredSelection selection=(StructuredSelection)tableViewerCustomerNurse.getSelection();
				if(selection.isEmpty())
					return;
				CustomerNurse nurse=(CustomerNurse)selection.getFirstElement();
				customerNurseMeals=customerNurseMealService.getCustomerNurseMeals(nurse);
				tableViewerCustomerNurseMeal.setInput(customerNurseMeals);
			}
		});
		tableCustomerNurse.setLinesVisible(true);
		tableCustomerNurse.setHeaderVisible(true);
		tableCustomerNurse.setLayoutData(BorderLayout.CENTER);
		tableViewerCustomerNurse.setContentProvider(new ArrayContentProvider());
		
		TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewerCustomerNurse, SWT.NONE);
		TableColumn tblclmnNewColumn = tableViewerColumn.getColumn();
		tblclmnNewColumn.setWidth(100);
		tblclmnNewColumn.setText("Name");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ((CustomerNurse)element).getCustomer().getName();
			}
			
		});
		TableViewerColumn tableViewerColumn_1 = new TableViewerColumn(tableViewerCustomerNurse, SWT.NONE);
		TableColumn tblclmnNewColumn_1 = tableViewerColumn_1.getColumn();
		tblclmnNewColumn_1.setWidth(100);
		tblclmnNewColumn_1.setText("Age");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return new Integer(((CustomerNurse)element).getAge()).toString();
			}
			
		});
		TableViewerColumn tableViewerColumn_16 = new TableViewerColumn(tableViewerCustomerNurse, SWT.NONE);
		TableColumn tblclmnHeight = tableViewerColumn_16.getColumn();
		tblclmnHeight.setWidth(100);
		tblclmnHeight.setText("Height");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurse)element).getHeight());
			}
		});
		TableViewerColumn tableViewerColumn_15 = new TableViewerColumn(tableViewerCustomerNurse, SWT.NONE);
		TableColumn tblclmnWeight = tableViewerColumn_15.getColumn();
		tblclmnWeight.setWidth(100);
		tblclmnWeight.setText("Weight");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurse)element).getWeight());
			}
			
		});
		TableViewerColumn tableViewerColumn_14 = new TableViewerColumn(tableViewerCustomerNurse, SWT.NONE);
		TableColumn tblclmnPal = tableViewerColumn_14.getColumn();
		tblclmnPal.setWidth(100);
		tblclmnPal.setText("PAL");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				CustomerPal pal=((CustomerNurse)element).getCustomerPal();
				return pal==null?"":pal.getName();
			}
			
		});
		TableViewerColumn tableViewerColumn_13 = new TableViewerColumn(tableViewerCustomerNurse, SWT.NONE);
		TableColumn tblclmnTarget = tableViewerColumn_13.getColumn();
		tblclmnTarget.setWidth(100);
		tblclmnTarget.setText("Target");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				NurseTarget target=((CustomerNurse)element).getNurseTarget();
				return target==null?"":target.getName();
			}
			
		});
		TableViewerColumn tableViewerColumn_12 = new TableViewerColumn(tableViewerCustomerNurse, SWT.NONE);
		TableColumn tblclmnNewColumn_10 = tableViewerColumn_12.getColumn();
		tblclmnNewColumn_10.setWidth(100);
		tblclmnNewColumn_10.setText("Start");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurse)element).getForeStartDate());
			}
			
		});
		TableViewerColumn tableViewerColumn_11 = new TableViewerColumn(tableViewerCustomerNurse, SWT.NONE);
		TableColumn tblclmnNewColumn_9 = tableViewerColumn_11.getColumn();
		tblclmnNewColumn_9.setWidth(100);
		tblclmnNewColumn_9.setText("End");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurse)element).getForeEndDate());
			}
			
		});
		TableViewerColumn tableViewerColumn_10 = new TableViewerColumn(tableViewerCustomerNurse, SWT.NONE);
		TableColumn tblclmnBust = tableViewerColumn_10.getColumn();
		tblclmnBust.setWidth(100);
		tblclmnBust.setText("Bust");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurse)element).getBust());
			}
			
		});
		TableViewerColumn tableViewerColumn_9 = new TableViewerColumn(tableViewerCustomerNurse, SWT.NONE);
		TableColumn tblclmnNewColumn_8 = tableViewerColumn_9.getColumn();
		tblclmnNewColumn_8.setWidth(100);
		tblclmnNewColumn_8.setText("Waist");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurse)element).getWaist());
			}
			
		});
		TableViewerColumn tableViewerColumn_8 = new TableViewerColumn(tableViewerCustomerNurse, SWT.NONE);
		TableColumn tblclmnHip = tableViewerColumn_8.getColumn();
		tblclmnHip.setWidth(100);
		tblclmnHip.setText("Hip");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurse)element).getHips());
			}
			
		});
		Composite composite_1 = new Composite(parent, SWT.NONE);
		composite_1.setLayout(new GridLayout(1, false));
		GridData gd_composite_1 = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
		gd_composite_1.widthHint = 372;
		composite_1.setLayoutData(gd_composite_1);
		
		Group group = new Group(composite_1, SWT.NONE);
		group.setLayout(new BorderLayout(0, 0));
		group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		
		tableViewerCustomerNurseMeal = new TableViewer(group, SWT.BORDER | SWT.FULL_SELECTION);
		tableNurseMeal = tableViewerCustomerNurseMeal.getTable();
		tableNurseMeal.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				StructuredSelection selection=(StructuredSelection)tableViewerCustomerNurseMeal.getSelection();
				if(selection.isEmpty())
					return;
				CustomerNurseMeal meal=(CustomerNurseMeal)selection.getFirstElement();
				customerNurseMealRecipe=customerNurseMealRecipeService.getCustomerNurseMealRecipe(meal);
				tableViewerCustomerNurseMealRecipe.setInput(customerNurseMealRecipe);
			}
		});
		tableNurseMeal.setLinesVisible(true);
		tableNurseMeal.setHeaderVisible(true);
		tableViewerCustomerNurseMeal.setContentProvider(new ArrayContentProvider());
		
		TableViewerColumn tableViewerColumn_5 = new TableViewerColumn(tableViewerCustomerNurseMeal, SWT.NONE);
		TableColumn tblclmnNewColumn_5 = tableViewerColumn_5.getColumn();
		tblclmnNewColumn_5.setWidth(100);
		tblclmnNewColumn_5.setText("Name");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurseMeal)element).getName());
			}
			
		});
		TableViewerColumn tableViewerColumn_6 = new TableViewerColumn(tableViewerCustomerNurseMeal, SWT.NONE);
		TableColumn tblclmnNewColumn_6 = tableViewerColumn_6.getColumn();
		tblclmnNewColumn_6.setWidth(100);
		tblclmnNewColumn_6.setText("Alias");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurseMeal)element).getAlias());
			}
			
		});
		TableViewerColumn tableViewerColumn_21 = new TableViewerColumn(tableViewerCustomerNurseMeal, SWT.NONE);
		TableColumn tblclmnNewColumn_15 = tableViewerColumn_21.getColumn();
		tblclmnNewColumn_15.setWidth(100);
		tblclmnNewColumn_15.setText("Feature");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurseMeal)element).getFeature());
			}
			
		});
		TableViewerColumn tableViewerColumn_20 = new TableViewerColumn(tableViewerCustomerNurseMeal, SWT.NONE);
		TableColumn tblclmnNewColumn_14 = tableViewerColumn_20.getColumn();
		tblclmnNewColumn_14.setWidth(100);
		tblclmnNewColumn_14.setText("Taste");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				MealTaste taste=((CustomerNurseMeal)element).getMealTaste();
				return taste==null?"":taste.getName();
			}
			
		});
		TableViewerColumn tableViewerColumn_19 = new TableViewerColumn(tableViewerCustomerNurseMeal, SWT.NONE);
		TableColumn tblclmnNewColumn_13 = tableViewerColumn_19.getColumn();
		tblclmnNewColumn_13.setWidth(100);
		tblclmnNewColumn_13.setText("Meal's Family");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				MealFamily family=((CustomerNurseMeal)element).getMealFamily();
				return family==null?"":family.getName();
			}
			
		});
		TableViewerColumn tableViewerColumn_18 = new TableViewerColumn(tableViewerCustomerNurseMeal, SWT.NONE);
		TableColumn tblclmnNewColumn_12 = tableViewerColumn_18.getColumn();
		tblclmnNewColumn_12.setWidth(100);
		tblclmnNewColumn_12.setText("Effect");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurseMeal)element).getEffect());
			}
			
		});
		TableViewerColumn tableViewerColumn_17 = new TableViewerColumn(tableViewerCustomerNurseMeal, SWT.NONE);
		TableColumn tblclmnNewColumn_11 = tableViewerColumn_17.getColumn();
		tblclmnNewColumn_11.setWidth(100);
		tblclmnNewColumn_11.setText("Procedure");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurseMeal)element).getProcedure());
			}
			
		});
		TableViewerColumn tableViewerColumn_7 = new TableViewerColumn(tableViewerCustomerNurseMeal, SWT.NONE);
		TableColumn tblclmnNewColumn_7 = tableViewerColumn_7.getColumn();
		tblclmnNewColumn_7.setWidth(100);
		tblclmnNewColumn_7.setText("Comment");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurseMeal)element).getComment());
			}
			
		});
		TableViewerColumn tableViewerColumn_23 = new TableViewerColumn(tableViewerCustomerNurseMeal, SWT.NONE);
		TableColumn tblclmnNewColumn_17 = tableViewerColumn_23.getColumn();
		tblclmnNewColumn_17.setWidth(100);
		tblclmnNewColumn_17.setText("Version");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return new Integer(((CustomerNurseMeal)element).getVersion()).toString();
			}
			
		});
		TableViewerColumn tableViewerColumn_22 = new TableViewerColumn(tableViewerCustomerNurseMeal, SWT.NONE);
		TableColumn tblclmnNewColumn_16 = tableViewerColumn_22.getColumn();
		tblclmnNewColumn_16.setWidth(100);
		tblclmnNewColumn_16.setText("Version Comment");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurseMeal)element).getVersionComment());
			}
			
		});
		Group group_1 = new Group(composite_1, SWT.NONE);
		group_1.setLayout(new BorderLayout(0, 0));
		group_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		
		tableViewerCustomerNurseMealRecipe = new TableViewer(group_1, SWT.BORDER | SWT.FULL_SELECTION);
		tableNurseMealRecipe = tableViewerCustomerNurseMealRecipe.getTable();
		tableNurseMealRecipe.setHeaderVisible(true);
		tableNurseMealRecipe.setLinesVisible(true);
		tableViewerCustomerNurseMealRecipe.setContentProvider(new ArrayContentProvider());
		
		TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(tableViewerCustomerNurseMealRecipe, SWT.NONE);
		TableColumn tblclmnNewColumn_2 = tableViewerColumn_2.getColumn();
		tblclmnNewColumn_2.setWidth(100);
		tblclmnNewColumn_2.setText("Material");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				FoodMaterial m=((CustomerNurseMealRecipe)element).getFoodMaterial();
				return m==null?"":m.getName();
			}
			
		});
		TableViewerColumn tableViewerColumn_3 = new TableViewerColumn(tableViewerCustomerNurseMealRecipe, SWT.NONE);
		TableColumn tblclmnNewColumn_3 = tableViewerColumn_3.getColumn();
		tblclmnNewColumn_3.setWidth(100);
		tblclmnNewColumn_3.setText("Qty");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurseMealRecipe)element).getQty());
			}
			
		});
		TableViewerColumn tableViewerColumn_4 = new TableViewerColumn(tableViewerCustomerNurseMealRecipe, SWT.NONE);
		TableColumn tblclmnNewColumn_4 = tableViewerColumn_4.getColumn();
		tblclmnNewColumn_4.setWidth(100);
		tblclmnNewColumn_4.setText("Unit");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				Unit unit=((CustomerNurseMealRecipe)element).getUnit();
				return unit==null?"":unit.getName();
			}
			
		});
		TableViewerColumn tableViewerColumn_24 = new TableViewerColumn(tableViewerCustomerNurseMealRecipe, SWT.NONE);
		TableColumn tblclmnVersion = tableViewerColumn_24.getColumn();
		tblclmnVersion.setWidth(100);
		tblclmnVersion.setText("Version");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurseMealRecipe)element).getVersion());
			}
			
		});
		TableViewerColumn tableViewerColumn_25 = new TableViewerColumn(tableViewerCustomerNurseMealRecipe, SWT.NONE);
		TableColumn tblclmnComment = tableViewerColumn_25.getColumn();
		tblclmnComment.setWidth(100);
		tblclmnComment.setText("Comment");
		tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){

			@Override
			public String getText(Object element) {
				// TODO Auto-generated method stub
				return ObjectUtils.toString(((CustomerNurseMealRecipe)element).getComment());
			}
			
		});
		// TODO Auto-generated method stub

	}

	@Override
	public void setFocus() {
		// TODO Auto-generated method stub

	}
}
